Package edu.claflin.finder.algo
Class Algorithm
java.lang.Object
edu.claflin.finder.algo.Algorithm
- All Implemented Interfaces:
Processable<Graph,Graph>
- Direct Known Subclasses:
BreadthFirstTraversalSearch,BronKerbosch,Bundle,ClusteringAlgorithm,ConnectedComponentsDFS,DepthFirstTraversalSearch,DijkstraShortestPath,ExtremumSpanningTree,MatrixPatternAnalyzer,ShortestPath
Abstraction of the algorithm classes used for finding subgraphs.
- Version:
- 3.4 February 2. 2015
- Author:
- Charles Allen Schultz II
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal ArgumentsBundleThe ArgumentsBundle object holding arguments for the algorithm.private intprivate PropertyChangeSupportAdds Property Change support to track the progress of algorithms.private intNumber passed in using partite number.private doubleThe current progress of the algorithm.static final StringConstant for indicating the progress property.private Algorithm.GraphSortOrderprivate String -
Constructor Summary
ConstructorsConstructorDescriptionAlgorithm(ArgumentsBundle args) Public Constructor for creating an Algorithm. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a PropertyChangeListener.private booleanCompares the two graphs based on edges.Removes duplicate subGraphs from the provided ArrayList.intintvoidRemoves a PropertyChangeListener.voidvoidsetMinNodeCount(int minNodeCount) voidsetPartiteNumber(int partiteNumber) protected voidsetProgress(double progress) voidsetWeightName(String weightName) protected static Stringzeropad(int number, int size) A utility method to zeropad subgraph numbers (001, 002, ..., 050, ..., 150, ...)Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface edu.claflin.finder.logic.processor.Processable
process
-
Field Details
-
minNodeCount
private int minNodeCount -
weightName
-
args
The ArgumentsBundle object holding arguments for the algorithm. -
mPCS
Adds Property Change support to track the progress of algorithms. -
progress
private double progressThe current progress of the algorithm. -
partiteNumber
private int partiteNumberNumber passed in using partite number. Somewhat of a bandaid fix because haven't figured out the arguments bundle yet - kpuli -
PROP_PROGRESS
Constant for indicating the progress property.- See Also:
-
sortOrder
-
-
Constructor Details
-
Algorithm
Public Constructor for creating an Algorithm.- Parameters:
args- the ArgumentsBundle containing the arguments for the Algorithm object.
-
-
Method Details
-
getGraphSortOrder
-
setGraphSortOrder
-
getMinNodeCount
public int getMinNodeCount() -
setMinNodeCount
public void setMinNodeCount(int minNodeCount) -
getWeightName
-
setWeightName
-
getPartiteNumber
public int getPartiteNumber() -
setPartiteNumber
public void setPartiteNumber(int partiteNumber) -
cull
Removes duplicate subGraphs from the provided ArrayList. This ensures that all found Graphs are unique.- Parameters:
subGraphs- the ArrayList containing the subGraphs to remove duplicates from.- Returns:
- the ArrayList of Graph objects containing only unique subgraphs.
-
zeropad
A utility method to zeropad subgraph numbers (001, 002, ..., 050, ..., 150, ...)- Parameters:
number- the number to zeropadsize- the total number of subgraphs (needed to know how many 0s to pad)- Returns:
- the zeropaded subgraph number
-
compare
Compares the two graphs based on edges. Tests to see that the smaller graph is essentially a subGraph of the larger.- Parameters:
base- the Graph object (smaller) to match.match- the Graph object (larger) to test against.- Returns:
- a boolean primitive indicating if the smaller Graph is a subgraph of the larger.
-
setProgress
protected void setProgress(double progress) -
addPropertyChangeListener
Adds a PropertyChangeListener.- Parameters:
pcl- the PropertyChangeListener.
-
removePropertyChangeListener
Removes a PropertyChangeListener.- Parameters:
pcl- the PropertyChangeListener.
-